package com.tuanzi.loan.business.service.xhh.settlementsystem.impl;

import com.tuanzi.loan.business.entity.xhh.settlementsystem.XhhSettlementRemain;
import com.tuanzi.loan.business.repository.xhh.settlementsystem.XhhSettlementRemainRepository;
import com.tuanzi.loan.business.service.xhh.settlementsystem.XhhSettlementRemainService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.xhh.settlementsystem.XhhSettlementRemainRequest;
import com.tuanzi.loan.vo.response.xhh.settlementsystem.XhhSettlementRemainResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author caiwanlin
 * @create 2018-08-22 17:44
 */
@Debug
@Service
@Transactional
@Retryable(value = {RetryException.class})
public class XhhSettlementRemainServiceImpl extends BaseAuditServiceImpl<XhhSettlementRemain,Long> implements XhhSettlementRemainService {
    @Autowired
    private XhhSettlementRemainRepository settlementRemainRepository;

    @Override
    public Page<XhhSettlementRemainResponse> list(PageSearcher<XhhSettlementRemainRequest> pageSearcher) {
        return settlementRemainRepository.list(pageSearcher.getSearchCondition(),pageSearcher.getPageable());
    }

    @Override
    protected JPAAuditRepository<XhhSettlementRemain, Long> getRepository() {
        return settlementRemainRepository;
    }
}
